home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / volumerel.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-22  |  2KB  |  87 lines

  1. /* RelProjectVolume.rexx V3.0 -- Changes the volume of a project globaly  */
  2. /* By Bob Caron (Grue) ©1995 NewTek Inc.                                  */
  3.  
  4. arg frompopup
  5. if frompopup="" then frompopup=0
  6.  
  7. call remlib('PROJECT_REXX_PORT')
  8.  
  9. call addlib('PROJECT_REXX_PORT',0)
  10. call set_view(2)
  11.  
  12. call req_error("RelProjectVolume V3.0     ---    Change project volume by value.")
  13.  
  14. done=0
  15. do while done=0
  16.   selection=req_tell("Max RelProject Volume V3.0","'Continue' to effect ALL croutons","'Cancel' to effect selected croutons")
  17.   done=1
  18.   if selection=0 & frompopup=0 then do
  19.     if req_tell("Error:","You can only use this feature if you","launch this script from the tools","popup menu.")=0 then call quit()
  20.     done=0
  21.     end
  22. end
  23. if selection=1 then frompopup=0 else frompopup=1
  24.  
  25. project_end=croutonsinproject()
  26. location=1
  27. do count=1 to project_end
  28.   if croutonselectedpos(count)=1 | frompopup=0 then do
  29.      selected.location=count-1
  30.      location=location+1
  31.      end
  32. end
  33.  
  34. location=location-1
  35.  
  36. current_spot=0
  37. highvol=0
  38.  
  39. volume=req_string("Raise/Lower Project volume by:",-10)
  40. if volume="CANCEL" then call quit
  41. if req_tell("Are you sure?")=0 then call quit()
  42. if volume=0 then call quit()
  43.  
  44. volume=(volume*655.35)
  45. current_spot=0
  46.  
  47. call req_open("Working... Please wait.")
  48. chunk=100/location;last=0;dots=0
  49. do count=1 to location
  50.    if crnumtype(selected.count)="CLIP" | crnumtype(selected.count)=" AUD" then do
  51.       vol1=(crnumgettag(selected.count,AUDIOVOLUME1)+volume)
  52.       if vol1<0 then vol1=0
  53.       if vol1>65535 then vol1=65535
  54.       call crnumsettag(selected.count,AUDIOVOLUME1,vol1)
  55.       vol2=(crnumgettag(selected.count,AUDIOVOLUME2)+volume)
  56.       if vol2<0 then vol2=0
  57.       if vol2>65535 then vol2=65535
  58.       call crnumsettag(selected.count,AUDIOVOLUME2,vol2)
  59.       last=trunc(dots/10)+1
  60.       dots=dots+chunk;string=copies(".",trunc(dots/10)+1)
  61.       if (last~=trunc(dots/10)+1) then do
  62.          if (11-length(string)>-1) then
  63.             call req_error("[Working"||string||right('           ',11-length(string))||"]")
  64.          end
  65.       end
  66. end
  67.  
  68. call req_close()
  69. call req_error("")
  70. call req_error("All done.")
  71. call projectupdate()
  72. call remlib("PROJECT_REXX_PORT")
  73. exit
  74.  
  75. quit:
  76.  
  77. call req_error("Canceled.")
  78. call remlib("PROJECT_REXX_PORT")
  79.  
  80. exit
  81.  
  82. croutonselectedpos:
  83. arg pos
  84. row=trunc(pos/8)
  85. col=pos-(row*8)
  86. row=row+1
  87. return croutonselected(row,col)